fix reversions
authorJoey Hess <joeyh@joeyh.name>
Mon, 10 Feb 2025 19:18:10 +0000 (15:18 -0400)
committerJoey Hess <joeyh@joeyh.name>
Mon, 10 Feb 2025 19:18:10 +0000 (15:18 -0400)
Oops, in 0b9e9cbf70c6375c8ccccdfac95b5e04ca09f891 I lost takeDirectory
in several places.

With this fixed, the test suite no longer utterly blows up, but still
fails in 7 places due to other bugs introduced in the OsPath conversion.

Sponsored-by: Graham Spencer
Annex/Transfer.hs

index aa04ff1a257d4c7ec5bdce2519222512e093dfb5..c2fbfa5786a674c09e1074f337c694f003d93d32 100644 (file)
@@ -161,7 +161,7 @@ runTransfer' ignorelock t eventualbackend afile stalldetection retrydecider tran
                                                createtfile
                                                return (Just (lockhandle, Nothing), False)
                                        Just oldlckfile -> do
-                                               createAnnexDirectory oldlckfile
+                                               createAnnexDirectory $ takeDirectory oldlckfile
                                                tryLockExclusive (Just mode) oldlckfile >>= \case
                                                        Nothing -> do
                                                                liftIO $ dropLock lockhandle
@@ -181,14 +181,14 @@ runTransfer' ignorelock t eventualbackend afile stalldetection retrydecider tran
                                )
 #else
        prep lckfile moldlckfile createtfile _mode = catchPermissionDenied (const prepfailed) $ do
-               createAnnexDirectory lckfile
+               createAnnexDirectory $ takeDirectory lckfile
                catchMaybeIO (liftIO $ lockExclusive lckfile) >>= \case
                        Just (Just lockhandle) -> case moldlckfile of
                                Nothing -> do
                                        createtfile
                                        return (Just (lockhandle, Nothing), False)
                                Just oldlckfile -> do
-                                       createAnnexDirectory oldlckfile
+                                       createAnnexDirectory $ takeDirectory oldlckfile
                                        catchMaybeIO (liftIO $ lockExclusive oldlckfile) >>= \case
                                                Just (Just oldlockhandle) -> do
                                                        createtfile